import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import vn.com.msb.cnn.accounts.AS400_PortType;
import vn.com.msb.cnn.accounts.AS400_ServiceLocator;
import vn.com.msb.cnn.utils.Messages;

public class testMain {
	public static void main(String args[]) {
		AS400_ServiceLocator as400Service;
		AS400_PortType as400Port;

		as400Service = new AS400_ServiceLocator();
		// as400Service.setServiceTimeout(30 * 1000);
		as400Service.setAS400HttpPortEndpointAddress("http://10.0.2.12:7800/OneConnectServices/services/AS400");
		try {
			as400Port = as400Service.getAS400HttpPort();
			String sendMessage = "*LINX|10.1.1.1||||213|42|0200||ABCS|*LINX|||||||BBHTLMONEYFNC|||||||TT110001|al|EB8277||||3843|*MOSA||10.1.1.1|||||T9999|||TT110001|31844|N||||EB8277|031111||VD|al|TT110002|020|0|1|N|N|N|N|N|N|N|020211110331844||10000000|||||0000000000280898009|02001019001831|||||||||0.000||10000000||||||10000000|10000000||10000000||VND|213591|||||||||||VND|VND|VND|VND|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||VND||||||||||||||02001019001831||0.000|||000|000||||||||10000000|||||||||||||||||||||||||||||||||||||||||||||||||||||RM        C                            OL2                                                                                                                                                                             SMSBK       VND                                                  CTRAN DAC THANG                                                                                                                                                                                                                              T0000000000280898009123456789           TRAN ANH TU                             01202005                                   BIDV HA THANH                           HOAN KIEM                                                                                                        0000000000000000000      000000000000000000000000000000000000000000000010000000                                                                                                                                                            |";
			Messages retMessage = as400Port.hostMessageSending("EBANK001", sendMessage);
			if (retMessage != null) {

			}
			System.out.println("");
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
